package com.mistywood.threads;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.mistywood.Config;

public class TimeOfDay implements Runnable
{
	@Override
	public void run()
	{
		DateFormat dateFormat;
		Date date;
		while (Config.SERVER_MODE == 1)
		{
			dateFormat = new SimpleDateFormat("HH:mm");
			date = new Date();
			System.out.println(dateFormat.format(date));
			try
			{
				Thread.currentThread();
				Thread.sleep(60000); // refresh every 1 minute
			}
			catch (InterruptedException e)
			{
				e.printStackTrace();
			}
		}
	}
}
